//引入request因为里面封装了axios
import request from '@/utils/request'

export default{
    //1.添加课程信息
    addCourse(courseVo){
        return request({
            url: `/eduservice/course/addCourseInfo`,
            method:'post',
            data: courseVo
        })
    },
    //2.查询所有讲师,用于二级联动
    getListTeacher(){
        return request({
            url:`/eduservice/teacher/findAll`,
            method:'get'
        })
    },
    //3.根据课程id查询课程信息
    getCourseInfo(courseId){
        return request({
            url:`/eduservice/course/getCourseInfo/${courseId}`,
            method:'get'
        })
    },
    //4.修改课程信息
    updateCourseInfo(courseVo){
        return request({
            url:`/eduservice/course/updateCourseInfo`,
            method:'post',
            data:courseVo
        })
    },
    //5.根据课程id查询最终课程信息
    getPublishCourseInfo(id){
        return request({
            url:`/eduservice/course/getPublishCourseInfo/${id}`,
            method:'get',
        })
    },
    //6.课程发布(修改status字段值)
    publishCourse(id){
        return request({
            url:`/eduservice/course/publishCourse/${id}`,
            method:'post',
        })
    },
    //7.课程列表
    getListCourse(current,limit,coursePageVo){
        return request({
            url:`/eduservice/course/pageCourseCondition/${current}/${limit}`,
            method:'post',
            data:coursePageVo
        })
    },
    //8.删除课程信息
    deleteCourse(id){
        return request({
            url:`/eduservice/course/${id}`,
            method:'delete',
        })
    }
}